
问题跟原因之间看起来没有什么直接的联系,不过勒, OpenCV Error: Bad argument (Wrong shapes for given matrices. Was size(src) = (1,921600),
size(W) = (307200,6).) in subspaceProject, 这种错误,一般是因为妳所调用的那个 opencv api只支持灰度图,而妳却载入了一张彩色图而造成的。
http://stackoverflow.com/questions/12032658/wrong-shapes-for-given-matrices-in-opencv
亮点:
Although you don't provide enough code to verify, I can infer the problem from the given number of elements. Your test matrix is 921600 = 3 * 307200 ... So I guess your input matrix is not a grayscale matrix, but still is in BGR representation.
You should use cv::cvtColor to convert the matrix to grayscale, before resizing it:
未知美人
HxLauncher: Launch Android applications by voice commands